<%@page pageEncoding="UTF-8" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<% String path = request.getContextPath(); %>
<html>
	<head>
		<title>人员信息修改页面</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<style type="text/css">
<!--
body,td,th {
	font-size: 12px;
}
-->
</style>
<base target="_self"/>
<script type="text/javascript" src="<%=path%>/javaScript/Calendar.js"></script>
</head>
<jsp:include page="../common/init.jsp"></jsp:include>
	<%
 response.setHeader("Pragma", "No-cache");
 response.setHeader("Cache-Control", "no-cache");
 response.setDateHeader("Expires", 0);
%>
<% if(request.getAttribute("result")!=null && request.getAttribute("result").toString().equals("OK")) {%>
<script language="javascript">
//向父窗口返回的值
window.returnValue = "这是子窗口返回来的值,需要刷新父窗口";
window.close();
</script>
<%
 }  
%>
<script type="text/javascript">
//验证姓名
function validateXm()
{
	var checkId="ryjbxx.xm";
	var checkValue=document.getElementById("ryjbxx.xm").value;
	var errorDivId="xmDiv";
	var errorImgId="xmImg";
	if(checkNullValue(checkValue))
	{
		showMenuDelegate(checkId,errorDivId,errorImgId,"姓名不能为空!");
		return false;
	}
	else if (checkValue.length>50)
	{
		showMenuDelegate(checkId,errorDivId,errorImgId,"姓名长度不能超过50个字!");
		return false;
	}
	else
	{
		hiddenErrorImg(errorImgId);
		return true;
	}
}
//验证Email
function validateEmail()
{
	var checkId="ryjbxx.dzyj";
	var checkValue=document.getElementById("ryjbxx.dzyj").value;
	var errorDivId="dzyjDiv";
	var errorImgId="dzyjImg";
	var result= checkValue.match(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/);
	if(!checkNullValue(checkValue)&&result==null)
	{
		showMenuDelegate(checkId,errorDivId,errorImgId,"电子邮件地址格式不正确!");
		return false;
	}
	else
	{
		hiddenErrorImg(errorImgId);
		return true;
	}
}
//验证备注说明
function validateRemark()
{
	var checkId="ryjbxx.beizhu";
	var checkValue=document.getElementById("ryjbxx.beizhu").value;
	var errorDivId="beizhuDiv";
	var errorImgId="beizhuImg";
	if(checkValue.length>100)
	{
		showMenuDelegate(checkId,errorDivId,errorImgId,"备注说明不能超过100字!");
		return false;
	}
	else
	{
		hiddenErrorImg(errorImgId);
		return true;
	}
}
//验证排序号是否为数字
function validatePxh()
{	
	var checkId="ryjbxx.pxh";
	var checkValue=document.getElementById("ryjbxx.pxh").value;
	var errorDivId="pxhDiv";
	var errorImgId="pxhImg";
	if(checkNullValue(checkValue))
	{
		showMenuDelegate(checkId,errorDivId,errorImgId,"排序号不能为空!");
		return false;
	}
	else if(!isInt(checkValue))
	{
		showMenuDelegate(checkId,errorDivId,errorImgId,"排序号必须为正整数!");
		return false;
	}
	else
	{
		hiddenErrorImg(errorImgId);
		return true;
	}
}
//验证年龄是否为数字
function validateNl()
{
	var checkId="ryjbxx.nl";
	var checkValue=document.getElementById("ryjbxx.nl").value;
	var errorDivId="nlDiv";
	var errorImgId="nlImg";
	if(!checkNullValue(checkValue)&&!isInt(checkValue))
	{
		showMenuDelegate(checkId,errorDivId,errorImgId,"年龄必须为正整数!");
		return false;
	}
	else
	{
		hiddenErrorImg(errorImgId);
		return true;
	}
}
//选择部门
function selBmxx()
{
	var action="<%=request.getContextPath() %>/qxgl/selBmxx.do?tempid=" + Math.random();
	win = window.showModalDialog(action,null,'dialogHeight=450px;dialogWidth=310px;status=no;scroll=no;help=no');
    callback(win);
	//openWindow=window.open(action, "newwin", "height=450, width=300,top=100,left=100,toolbar=no,scrollbars=no,menubar=no");
}
function callback(rValue){
	if(rValue!=null)
	{
		bmxx=rValue;
		document.getElementById("bmbh").value=bmxx[0];
		document.getElementById("bmmc").value=bmxx[1];
	}
}
//提交
function doSubmit()
{
	//if(validateXm()&&validatePxh()&&validateEmail()&&validateRemark())
	if(validateXm())
	{
		document.forms[0].action="reworkRyjbxx.do";
		document.forms[0].submit();
	}
	else
	{
		return false;
	}
}
//页面关闭
function winClose()
{
	window.returnValue = "ok";
	window.close();
}
//表单reset
function formReset()
{
	document.forms[0].reset();
}
//提示信息
function showMessage(){
	var message="<%=request.getAttribute("info")%>";
	if(message != "null" && message != ""){
		document.getElementById('errorDivCreateWzbm').innerHTML='提示信息:<span style="font-size:12px;color:#ff0000">' + message + '</span>';
		document.getElementById('errorDivCreateWzbm').style.display="inline";
		document.getElementById('errorDivCreateWzbm').focus();
	}
}
//产生日历框
var cdr = new Calendar("cdr");
document.write(cdr);
cdr.showMoreDay = true;
//生成功能按钮	
mpmenu1=new mMenu('','winClose()','script','<%=request.getContextPath() %>/images/img_ht_wz_44.gif','62','24','0','100','2');
mpmenu2=new mMenu('','#','self','<%=request.getContextPath() %>/images/img_ht_wz_38.gif','62','24','0','20','0');
mpmenu3=new mMenu('','#','self','<%=request.getContextPath() %>/images/img_ht_wz_42.gif','62','24','0','20','0');
</script>
	<body onload="showMessage()">
		<s:form action="">
<table width="100%" cellspacing="0" cellpadding="0" class="main_tab1">
    <tr>
        <td rowspan="4" class="main_tab1_td8">&nbsp;</td>
        <td class="main_tab1_td1"><img src="<%=request.getContextPath() %>/images/img_ht_wz_28.gif" alt="left" /></td>
        <td class="main_tab1_td2">
		<div id="location">人员信息修改</div>
		<div id="funbut">
			<SCRIPT>document.write(mwritetodocument());</SCRIPT>
			
		</div>
		</td>
        <td class="main_tab1_td1"><img src="<%=request.getContextPath() %>/images/img_ht_wz_32.gif" alt="right" /></td>
    </tr>
    <tr>
        <td colspan="3" class="main_tab1_td3">
		<div id="mainbg">
		<div class="jiange10"></div>
		<table width="100%"  cellspacing="0" cellpadding="0" class="main_tab3">
				<tr valign="bottom" height="30">
					<td height="35" colspan="4" align="left" valign="bottom"
						class="r_tab_c_4">
						<div id="errorDivCreateWzbm"></div>
						<s:hidden name="ryjbxx.rybh"></s:hidden>
						<s:hidden name="ryjbxx.scbz"></s:hidden>
						<s:hidden name="ryjbxx.cjr"></s:hidden>
						<s:hidden name="ryjbxx.cjrq"></s:hidden>
					</td>
				</tr>
			<tr valign="bottom" align="center" height="30">
					<th align="right">
						姓名：
					</th>
					<td width="230" height="35" align="left" valign="bottom"
						class="r_tab_c_4" colspan="3">
								<s:textfield id="ryjbxx.xm" name="ryjbxx.xm" size="15" maxLength="50"
								theme="simple" onclick="javascript: mouseClick('xmDiv')" 
								onfocus="this.style.borderColor='#68A6F5'" onblur="validateXm();" cssClass="inp_02">
					</s:textfield>
						 &nbsp;<font color="#ff0000">*</font>
				<img src="" id="xmImg" style="display:none;"/>
				<div id="xmDiv" style="background:#008080;display:none;cursor:default"/>
					</td>
				</tr>
				<tr valign="bottom" height="30">
					<th height="35" align="right">
						性别：
					</th>
					<td height="35" align="left" valign="bottom" class="r_tab_c_4">
					<s:select list="sexList" name="ryjbxx.xb" theme="simple" listKey="zwmc" listValue="zwmc"></s:select>
					</td>
					<th align="right">
						排序号：
					</th>
					<td height="35" colspan="3" align="left" valign="bottom" class="r_tab_c_4">
								<s:textfield name="ryjbxx.pxh"  size="2"
							maxLength="2" theme="simple" onclick="javascript: mouseClick('pxhDiv')" 
								onfocus="this.style.borderColor='#68A6F5'" onblur="validatePxh();" cssClass="inp_02">
					</s:textfield>
						 &nbsp;<font color="#ff0000">*</font>
				<img src="" id="pxhImg" style="display:none;"/>
				<div id="pxhDiv" style="background:#008080;display:none;cursor:default"/>						
					</td>
				</tr>
							<tr valign="bottom" height="30">
				<th align="right">
						出生日期：
					</th>
					<td height="35" align="left" valign="bottom" class="r_tab_c_4">
			<input type="text"  title="点击日历选择日期" value="<s:property value="ryjbxx.csrq"/>" size="8" onKeyUp="inPutDay(this)" onBlur="checkDayIsValid(this);" onclick="cdr.show(this,getObjById('csrq'));" id="csrq" name="ryjbxx.csrq" class="pale date"/>
 			<img align="absMiddle" id="mm_bbcPos" name="mm_bbcPos" style="cursor:hand;" src="<%=request.getContextPath() %>/images/calendar.gif" width="21" height="21" onMouseUp="cdr.show(this,getObjById('csrq'))" >
			&nbsp;&nbsp;
					</td>
					<th align="right">
						所属部门：
					</th>
					<td height="35" align="left" valign="bottom" class="r_tab_c_4">
					<s:hidden name="bmbh" id="sjbmbh" ></s:hidden>
					<s:textfield id="bmmc"  name="bmmc"  theme="simple" size="25" maxLength="50" cssClass="inp_02" disabled="true"/>
					&nbsp;
					<a href="javascript:void(0)" onfocus="this.blur()" >
					<img src="<%=request.getContextPath() %>/images/img_ht_wz_82.gif" border="0"  onclick="selBmxx();" ></a>
					</td>
				</tr>
				<tr valign="bottom" height="30">
					<th align="right">
						联系电话：
					</th>
					<td height="35" align="left" valign="bottom" class="r_tab_c_4">
									<s:textfield name="ryjbxx.lxdh" size="15" maxLength="20"
										theme="simple" cssClass="inp_02"></s:textfield>
										 &nbsp;&nbsp;
					</td>
					<th align="right">
						职务：
					</th>
					<td height="35" align="left" valign="bottom" class="r_tab_c_4">
					<s:select list="zwList" name="ryjbxx.zw" theme="simple"  listKey="zwmc" listValue="zwmc" headerKey="" headerValue="请选择">
					</s:select>
										 &nbsp;&nbsp;
					</td>
				</tr>
				<tr valign="bottom" height="30">
					<th align="right">
						Email：
					</th>
					<td height="35" align="left" valign="bottom" class="r_tab_c_4">
									<s:textfield id="ryjbxx.dzyj" name="ryjbxx.dzyj" size="20" maxLength="50"
										theme="simple"  onclick="javascript: mouseClick('dzyjDiv')" 
								onfocus="this.style.borderColor='#68A6F5'" onblur="validateEmail();" cssClass="inp_02">
					</s:textfield>
											 &nbsp;
				<img src="" id="dzyjImg" style="display:none;"/>
				<div id="dzyjDiv" style="background:#008080;display:none;cursor:default"/>
					</td>
					<th align="right">
						专业：
					</th>
					<td height="35" align="left" valign="bottom" class="r_tab_c_4">
									<s:textfield name="ryjbxx.zy" size="10" maxLength="15"
										theme="simple" cssClass="inp_02"></s:textfield>
										 &nbsp;&nbsp;
					</td>
				</tr>
				<tr valign="bottom" height="30">
					<th align="right">
						家庭地址：
					</th>
					<td height="35" align="left" valign="bottom" class="r_tab_c_4">
									<s:textfield name="ryjbxx.jtdz" size="20" maxLength="50"
										theme="simple" cssClass="inp_02"></s:textfield>
										 &nbsp;
					</td>
					<th align="right">
						学历：
					</th>
					<td height="35" align="left" valign="bottom" class="r_tab_c_4">
					<s:select list="xlList" name="ryjbxx.xl" theme="simple" listKey="zwmc" listValue="zwmc" headerKey="" headerValue="请选择"></s:select>
					&nbsp;&nbsp;
					</td>
				</tr>
				<tr valign="bottom" height="30">
					<th align="right">
						毕业学校：
					</th>
					<td height="35" colspan="3" align="left" valign="bottom" class="r_tab_c_4">
									<s:textfield name="ryjbxx.byxx" size="20" maxLength="50"
										theme="simple" cssClass="inp_02"></s:textfield>
										 &nbsp;&nbsp;
					</td>
				</tr>
				<tr valign="bottom" height="30">
					<th valign="middle" align="right">
						备注说明：
					</th>
					<td height="35" colspan="3" align="left" valign="bottom" class="r_tab_c_4">
						<s:textarea id="ryjbxx.beizhu" name="ryjbxx.beizhu" cols="40" rows="6"
							theme="simple" onclick="javascript: mouseClick('beizhuDiv')" 
								onfocus="this.style.borderColor='#68A6F5'" onblur="validateRemark();" >
					</s:textarea>
						 &nbsp;
				<img src="" id="beizhuImg" style="display:none;"/>
				<div id="beizhuDiv" style="background:#008080;display:none;cursor:default"/>
					</td>
				</tr>
			</table>
			<div class="butk">
<div class="btn_01">
<a href="#" onclick="doSubmit()">保&nbsp;存</a>
</div>
<div class="btn_01">
<a href="#" onclick="formReset()">清&nbsp;除</a>
</div>
</div>
</div>
</td>
    </tr>
        <tr>
        <td class="main_tab1_td4"><img src="<%=request.getContextPath() %>/images/img_ht_wz_65.gif" alt="left" /></td>
        <td class="main_tab1_td5"></td>
        <td class="main_tab1_td4"><img src="<%=request.getContextPath() %>/images/img_ht_wz_67.gif" alt="right" /></td>
    </tr>
    <tr>
        <td colspan="3" class="main_tab1_td7">&nbsp;</td>
    </tr>
</table>
		</s:form>
	</body>
</html>